<%@page import="java.util.Calendar"%>
<%@page import="java.sql.Timestamp"%>
<%@page import="java.sql.SQLException"%>
<%@page import="nnweboa.DB"%>
<%@page import="nnweboa.Userinfo"%>
<%@page import="java.util.List"%>
<%@page import="nnweboa.Unitls"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	if (!request.getParameter("user").isEmpty()) {

		Userinfo userinfo = Unitls.findByMail(
		request.getParameter("user"), out).get(0);
		Timestamp  tp  = new Timestamp(Calendar.getInstance().getTimeInMillis());
		userinfo.setmodifydate(tp);
		userinfo.setpassword(Unitls.getPassword());

		DB.UpdateuserInfo(userinfo);

		Unitls.SendPasswordWithUserInfo(userinfo);

		out.println("保存密码成功!{" + userinfo.getPassword() + "}");
		//goto first page 
	} else {
		// goto error page

	}
%>